<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>企业招聘页面</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/recruitment.css">
    <!-- 语义化头部导航 -->
    <header class="header">
        <div class="logo">企业招聘系统</div>

        <div class="user-profile">
            <span class="company-name" id="current-company-name">示例科技有限公司</span>
            <div class="avatar" onclick="window.location.href='company-profile.html'"></div>
        </div>
    </header>
        <!-- 顶部导航栏已重构至语义化header标签 -->

    <!-- 主体内容 -->
    <div class="main-container">
        <!-- 左侧功能导航区 -->
        <div class="sidebar">
            <ul>
                <li onclick="showModule('job-posting')">职位发布</li>
                <li onclick="showModule('job-management')">职位管理</li>
                
                <li onclick="showModule('resume-screening')">简历筛选</li>
                <li onclick="showModule('interview-notice')">面试通知</li>
                <li onclick="showModule('data-stats')">数据统计</li>
            </ul>
        </div>

        <!-- 右侧内容区 -->
        <div class="content" id="content">
            <!-- 职位发布模块 -->
            <div id="job-posting" class="module">
                <h2>职位发布</h2>
                <form class="job-form" id="jobPostForm">
                    <div class="form-group">
                        <label for="job-title">职位名称*</label>
                        <input type="text" id="job-title" required>
                        <div class="error-message">请输入职位名称</div>
                    </div>
                    <div class="form-group">
                        <label for="industry">所属行业*</label>
                        <select id="industry" required>
                            <option value="">请选择行业</option>
                            <option value="互联网">互联网</option>
                            <option value="金融">金融</option>
                            <option value="教育">教育</option>
                            <option value="医疗健康">医疗健康</option>
                            <option value="电子商务">电子商务</option>
                            <option value="游戏">游戏</option>
                            <option value="企业服务">企业服务</option>
                            <option value="其他">其他</option>
                        </select>
                        <div class="error-message">请选择行业</div>
                    </div>
                    <div class="form-group">
                        <label for="job-description">岗位描述*</label>
                        <textarea id="job-description" rows="4" required></textarea>
                        <div class="error-message">请输入岗位描述</div>
                    </div>
                    <div class="form-group">
                        <label for="salary-range">薪资范围*</label>
                        <input type="text" id="salary-range" required placeholder="例如：15k-25k">
                        <div class="error-message">请输入薪资范围</div>
                    </div>
                    <div class="form-group">
                        <label for="requirements">任职要求*</label>
                        <textarea id="requirements" rows="4" required></textarea>
                        <div class="error-message">请输入任职要求</div>
                    </div>
                    <div class="form-group">
                        <label for="location">工作地点*</label>
                        <input type="text" id="location" required>
                        <div class="error-message">请输入工作地点</div>
                    </div>
                    <div class="form-group">
                        <label for="job-type">工作类型*</label>
                        <select id="job-type" required>
                            <option value="">请选择工作类型</option>
                            <option value="full-time">全职</option>
                            <option value="part-time">兼职</option>
                            <option value="internship">实习</option>
                        </select>
                        <div class="error-message">请选择工作类型</div>
                    </div>
                    <div class="form-group">
                        <label for="experience">工作经验*</label>
                        <select id="experience" required>
                            <option value="">请选择工作经验</option>
                            <option value="fresh">应届生</option>
                            <option value="1-3">1-3年</option>
                            <option value="3-5">3-5年</option>
                            <option value="5+">5年以上</option>
                        </select>
                        <div class="error-message">请选择工作经验</div>
                    </div>
                    <div class="form-group">
                        <label for="education">学历要求*</label>
                        <select id="education" required>
                            <option value="">请选择学历要求</option>
                            <option value="大专">大专</option>
                            <option value="本科">本科</option>
                            <option value="硕士">硕士</option>
                            <option value="博士">博士</option>
                        </select>
                        <div class="error-message">请选择学历要求</div>
                    </div>
                    <div class="form-group">
                        <label for="benefits">公司福利</label>
                        <input type="text" id="benefits" placeholder="例如：五险一金,带薪年假,年终奖">
                    </div>
                    <div class="form-group">
                        <label for="highlights">职位亮点</label>
                        <input type="text" id="highlights" placeholder="例如：团队年轻,技术氛围好,晋升空间大">
                    </div>
                    <div class="form-group">
                        <label for="company-intro">公司简介补充</label>
                        <textarea id="company-intro" rows="4"></textarea>
                    </div>
                    <div class="form-actions">
                        <button type="button" class="btn save-btn" id="saveDraftBtn">保存草稿</button>
                        <button type="submit" class="btn submit-btn">提交发布</button>
                    </div>
                </form>
            </div>

            <!-- 职位管理模块 -->
            <div id="job-management" class="module" style="display: none;">
                <h2>职位管理</h2>
                <div class="job-management-container">
                    <table style="width:100%; border-collapse:collapse; background:#fff;">
                      <thead style="background:#fafafa;">
                        <tr>
                          <th>职位名</th>
                          <th>岗位类型</th>
                          <th>学历要求</th>
                          <th>工作经验</th>
                          <th>工资</th>
                          <th>工作地区</th>
                          <th>详细地址</th>
                          <th>操作</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <td>测试工程师</td>
                          <td>技术·测试</td>
                          <td>本科</td>
                          <td>在校生</td>
                          <td>50K-71K</td>
                          <td>北京市·北京市</td>
                          <td>海淀区钻石大厦</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                        <tr>
                          <td>算法工程师</td>
                          <td>技术·算法</td>
                          <td>博士</td>
                          <td>应届生</td>
                          <td>12K-20K</td>
                          <td>四川省·成都市</td>
                          <td>武侯区东方希望大厦</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                        <tr>
                          <td>java实习开发工程师</td>
                          <td>技术·后端</td>
                          <td>本科</td>
                          <td>在校生</td>
                          <td>5K-10K</td>
                          <td>广东省·深圳市</td>
                          <td>南山区 腾讯大厦</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                        <tr>
                          <td>java初级开发工程师</td>
                          <td>技术·后端</td>
                          <td>本科</td>
                          <td>一年以上</td>
                          <td>12K-20K</td>
                          <td>广东省·深圳市</td>
                          <td>南山区 腾讯大厦</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                        <tr>
                          <td>产品经理</td>
                          <td>产品·产品经理</td>
                          <td>本科</td>
                          <td>一年以上</td>
                          <td>50K-72K</td>
                          <td>北京市·北京市</td>
                          <td>海淀区华为大厦</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                        <tr>
                          <td>java高级开发工程师</td>
                          <td>技术·后端</td>
                          <td>本科</td>
                          <td>一年以上</td>
                          <td>12K-19K</td>
                          <td>北京市·北京市</td>
                          <td>北京市海淀区百度大厦</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                        <tr>
                          <td>算法工程师</td>
                          <td>技术·算法</td>
                          <td>博士</td>
                          <td>五年以上</td>
                          <td>50K-71K</td>
                          <td>广东省·深圳市</td>
                          <td>南山区 永新汇1号楼</td>
                          <td><button style="background:#ff5722;color:#fff;border:none;padding:6px 16px;border-radius:4px;cursor:pointer;">删除</button></td>
                        </tr>
                      </tbody>
                    </table>
                </div>
                
                <!-- 右侧数据统计 -->
                <div class="stats-sidebar">
                    <div class="stat-card">
                        <h3>累计发布职位</h3>
                        <p>12</p>
                    </div>
                    <div class="stat-card">
                        <h3>总浏览量</h3>
                        <p>1,250</p>
                    </div>
                    <div class="stat-card">
                        <h3>总投递人数</h3>
                        <p>235</p>
                    </div>
                    <div class="stat-card">
                        <h3>今日新增投递</h3>
                        <p>12</p>
                    </div>
                    <div class="stat-card">
                        <h3>平均简历评分</h3>
                        <p>4.2</p>
                    </div>
                </div>
            </div>

            <!-- 简历筛选模块 -->
            <div id="resume-screening" class="module" style="display: none;">
                <h2>简历筛选</h2>
                <div class="search-filter">
                    <input type="text" placeholder="姓名" class="search-input">
                    <select class="job-select"></select>
                    <select class="degree-select"></select>
                    <button class="search-btn">搜索</button>
                </div>
                <!-- 简历卡片列表 -->
                <div class="resume-list">
                    <!-- 简历卡片1 -->
                    <div class="resume-card">
                        <div class="resume-avatar">
                            <img src="https://img.icons8.com/ios-filled/50/000000/user-male-circle.png" alt="头像">
                            <span class="resume-tag resume-tag-green">在职</span>
                        </div>
                        <div class="resume-info">
                            <div class="resume-row">
                                <span>42岁</span> · <span>10年以上</span> · <span>大专</span> · <span>高职-顾的到岗</span>
                            </div>
                            <div class="resume-row">
                                <span>期望：广州</span> · <span>天猫运营</span>
                            </div>
                            <div class="resume-row">
                                <span>优势：</span>精通电商、商通电商运营，操作多个类目的市场，善总结思路，优化运营。
                            </div>
                            <div class="resume-row">
                                <span>经历：</span>广东义希兰品牌管理 电商<br>德创电子商务 国内电商运营<br>顺芯达家用电器 网店店长<br>广西财经学院 国际贸易 大专
                            </div>
                            <div class="resume-row resume-meta">
                                <span>2021.07 - 至今</span> · <span>2017.05 - 2021.06</span> · <span>2003 - 2005</span>
                            </div>
                        </div>
                        <div class="resume-actions">
                            <button class="resume-btn">查看简历</button>
                            <button class="resume-btn resume-btn-primary">发起面试通知</button>
                        </div>
                    </div>
                    <!-- 简历卡片2 -->
                    <div class="resume-card">
                        <div class="resume-avatar">
                            <img src="https://img.icons8.com/ios-filled/50/000000/user-female-circle.png" alt="头像">
                            <span class="resume-tag resume-tag-orange">4.6K</span>
                        </div>
                        <div class="resume-info">
                            <div class="resume-row">
                                <span>23岁</span> · <span>24年应届生</span> · <span>大专</span>
                            </div>
                            <div class="resume-row">
                                <span>期望：广州</span> · <span>阿玛尚云裳</span>
                            </div>
                            <div class="resume-row">
                                <span>优势：</span>在校期间，学习过计算机课程并取得了IT证书。
                            </div>
                            <div class="resume-row">
                                <span>经历：</span>富源德胜兰花产业发展服务 美工<br>鱼小铺 门店店长<br>广东松山职业技术学院 电子商务
                            </div>
                            <div class="resume-row resume-meta">
                                <span>2023.06 - 至今</span> · <span>2022.10 - 2023.06</span> · <span>2021 - 2024</span>
                            </div>
                        </div>
                        <div class="resume-actions">
                            <button class="resume-btn">收藏</button>
                            <button class="resume-btn resume-btn-primary">删除</button>
                        </div>
                    </div>
                </div>
                <style>
                .resume-list {
                    display: flex;
                    flex-direction: column;
                    gap: 18px;
                    margin-top: 24px;
                }
                .resume-card {
                    display: flex;
                    align-items: flex-start;
                    background: #fff;
                    border-radius: 10px;
                    box-shadow: 0 2px 8px #f0f1f2;
                    padding: 18px 24px;
                    gap: 18px;
                }
                .resume-avatar {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    min-width: 60px;
                    margin-right: 10px;
                }
                .resume-avatar img {
                    width: 48px;
                    height: 48px;
                    border-radius: 50%;
                    background: #f2f2f2;
                }
                .resume-tag {
                    margin-top: 8px;
                    padding: 2px 10px;
                    border-radius: 12px;
                    font-size: 13px;
                    color: #fff;
                    background: #52c41a;
                    display: inline-block;
                }
                .resume-tag-orange {
                    background: #fa541c;
                }
                .resume-tag-green {
                    background: #52c41a;
                }
                .resume-info {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                    gap: 4px;
                }
                .resume-row {
                    font-size: 15px;
                    color: #333;
                    line-height: 1.7;
                }
                .resume-row.resume-meta {
                    color: #888;
                    font-size: 13px;
                }
                .resume-actions {
                    display: flex;
                    flex-direction: column;
                    gap: 10px;
                    margin-left: 18px;
                }
                .resume-btn {
                    padding: 7px 18px;
                    border: none;
                    border-radius: 4px;
                    background: #f2f2f2;
                    color: #333;
                    font-size: 15px;
                    cursor: pointer;
                    transition: background 0.2s;
                }
                .resume-btn:hover {
                    background: #e6f7ff;
                }
                .resume-btn-primary {
                    background: #1890ff;
                    color: #fff;
                }
                .resume-btn-primary:hover {
                    background: #40a9ff;
                }
                </style>
            </div>

            <!-- 面试通知模块 -->
            <div id="interview-notice" class="module" style="display: none;">
                <!-- 简历卡片列表 -->
                <div class="resume-list">
                    <!-- 简历卡片1 -->
                    <div class="resume-card">
                        <div class="resume-avatar">
                            <img src="https://img.icons8.com/ios-filled/50/000000/user-male-circle.png" alt="头像">
                            <span class="resume-tag resume-tag-green">在职</span>
                        </div>
                        <div class="resume-info">
                            <div class="resume-row">
                                <span>42岁</span> · <span>10年以上</span> · <span>大专</span> · <span>高职-顾的到岗</span>
                            </div>
                            <div class="resume-row">
                                <span>期望：广州</span> · <span>天猫运营</span>
                            </div>
                            <div class="resume-row">
                                <span>优势：</span>精通电商、商通电商运营，操作多个类目的市场，善总结思路，优化运营。
                            </div>
                            <div class="resume-row">
                                <span>经历：</span>广东义希兰品牌管理 电商<br>德创电子商务 国内电商运营<br>顺芯达家用电器 网店店长<br>广西财经学院 国际贸易 大专
                            </div>
                            <div class="resume-row resume-meta">
                                <span>2021.07 - 至今</span> · <span>2017.05 - 2021.06</span> · <span>2003 - 2005</span>
                            </div>
                        </div>
                        <div class="resume-actions">
                            <button class="resume-btn">查看简历</button>
                            <button class="resume-btn resume-btn-primary">发起面试通知</button>
                        </div>
                    </div>
                    <!-- 简历卡片2 -->
                    <div class="resume-card">
                        <div class="resume-avatar">
                            <img src="https://img.icons8.com/ios-filled/50/000000/user-female-circle.png" alt="头像">
                            <span class="resume-tag resume-tag-orange">4.6K</span>
                        </div>
                        <div class="resume-info">
                            <div class="resume-row">
                                <span>23岁</span> · <span>24年应届生</span> · <span>大专</span>
                            </div>
                            <div class="resume-row">
                                <span>期望：广州</span> · <span>阿玛尚云裳</span>
                            </div>
                            <div class="resume-row">
                                <span>优势：</span>在校期间，学习过计算机课程并取得了IT证书。
                            </div>
                            <div class="resume-row">
                                <span>经历：</span>富源德胜兰花产业发展服务 美工<br>鱼小铺 门店店长<br>广东松山职业技术学院 电子商务
                            </div>
                            <div class="resume-row resume-meta">
                                <span>2023.06 - 至今</span> · <span>2022.10 - 2023.06</span> · <span>2021 - 2024</span>
                            </div>
                        </div>
                        <div class="resume-actions">
                            <button class="resume-btn">查看简历</button>
                            <button class="resume-btn resume-btn-primary">发起面试通知</button>
                        </div>
                    </div>
                </div>
                <style>
                .resume-list {
                    display: flex;
                    flex-direction: column;
                    gap: 18px;
                    margin-top: 24px;
                }
                .resume-card {
                    display: flex;
                    align-items: flex-start;
                    background: #fff;
                    border-radius: 10px;
                    box-shadow: 0 2px 8px #f0f1f2;
                    padding: 18px 24px;
                    gap: 18px;
                }
                .resume-avatar {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    min-width: 60px;
                    margin-right: 10px;
                }
                .resume-avatar img {
                    width: 48px;
                    height: 48px;
                    border-radius: 50%;
                    background: #f2f2f2;
                }
                .resume-tag {
                    margin-top: 8px;
                    padding: 2px 10px;
                    border-radius: 12px;
                    font-size: 13px;
                    color: #fff;
                    background: #52c41a;
                    display: inline-block;
                }
                .resume-tag-orange {
                    background: #fa541c;
                }
                .resume-tag-green {
                    background: #52c41a;
                }
                .resume-info {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                    gap: 4px;
                }
                .resume-row {
                    font-size: 15px;
                    color: #333;
                    line-height: 1.7;
                }
                .resume-row.resume-meta {
                    color: #888;
                    font-size: 13px;
                }
                .resume-actions {
                    display: flex;
                    flex-direction: column;
                    gap: 10px;
                    margin-left: 18px;
                }
                .resume-btn {
                    padding: 7px 18px;
                    border: none;
                    border-radius: 4px;
                    background: #f2f2f2;
                    color: #333;
                    font-size: 15px;
                    cursor: pointer;
                    transition: background 0.2s;
                }
                .resume-btn:hover {
                    background: #e6f7ff;
                }
                .resume-btn-primary {
                    background: #1890ff;
                    color: #fff;
                }
                .resume-btn-primary:hover {
                    background: #40a9ff;
                }
                </style>
            </div>

            <!-- 数据统计模块 -->
            <div id="data-stats" class="module" style="display: none;">
                <h2>数据统计</h2>
                <div class="stats-cards">
                    <div class="stat-card">
                        <div class="stat-title">累计发布职位</div>
                        <div class="stat-value">12</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-title">总浏览量</div>
                        <div class="stat-value">1,250</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-title">总投递人数</div>
                        <div class="stat-value">235</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-title">今日新增投递</div>
                        <div class="stat-value">12</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-title">平均简历评分</div>
                        <div class="stat-value">4.2</div>
                    </div>
                </div>
                <div class="charts-row">
                    <div class="chart-box">
                        <div class="chart-title">职位投递进度</div>
                        <svg width="120" height="120">
                            <circle cx="60" cy="60" r="50" stroke="#e6e6e6" stroke-width="12" fill="none"/>
                            <circle cx="60" cy="60" r="50" stroke="#1890ff" stroke-width="12" fill="none" stroke-dasharray="314" stroke-dashoffset="94"/>
                            <text x="60" y="68" text-anchor="middle" font-size="22" fill="#1890ff">70%</text>
                        </svg>
                    </div>
                    <div class="chart-box">
                        <div class="chart-title">近7日投递量</div>
                        <svg width="180" height="120">
                            <rect x="20" y="60" width="18" height="40" fill="#91d5ff"/>
                            <rect x="50" y="40" width="18" height="60" fill="#40a9ff"/>
                            <rect x="80" y="30" width="18" height="70" fill="#1890ff"/>
                            <rect x="110" y="50" width="18" height="50" fill="#40a9ff"/>
                            <rect x="140" y="70" width="18" height="30" fill="#91d5ff"/>
                            <text x="30" y="115" font-size="12" fill="#888">周一</text>
                            <text x="60" y="115" font-size="12" fill="#888">周二</text>
                            <text x="90" y="115" font-size="12" fill="#888">周三</text>
                            <text x="120" y="115" font-size="12" fill="#888">周四</text>
                            <text x="150" y="115" font-size="12" fill="#888">周五</text>
                        </svg>
                    </div>
                </div>
                <style>
                .stats-cards {
                    display: flex;
                    gap: 18px;
                    margin-bottom: 32px;
                }
                .stat-card {
                    background: #fff;
                    border-radius: 10px;
                    box-shadow: 0 2px 8px #f0f1f2;
                    padding: 18px 32px;
                    min-width: 140px;
                    text-align: center;
                }
                .stat-title {
                    font-size: 15px;
                    color: #888;
                    margin-bottom: 8px;
                }
                .stat-value {
                    font-size: 28px;
                    color: #1890ff;
                    font-weight: bold;
                }
                .charts-row {
                    display: flex;
                    gap: 32px;
                }
                .chart-box {
                    background: #fff;
                    border-radius: 10px;
                    box-shadow: 0 2px 8px #f0f1f2;
                    padding: 18px 32px;
                    min-width: 200px;
                    text-align: center;
                }
                .chart-title {
                    font-size: 15px;
                    color: #888;
                    margin-bottom: 12px;
                }
                </style>
            </div>
    </div>

    <script>
        // 切换模块显示
        function showModule(moduleId) {
            // 隐藏所有模块
            document.querySelectorAll('.module').forEach(module => {
                module.style.display = 'none';
            });
            // 显示选中模块
            const activeModule = document.getElementById(moduleId);
            if (activeModule) {
                activeModule.style.display = 'block';
            }
        }

        // 模拟点击职位名称进入详情页
        document.querySelectorAll('.job-name').forEach(item => {
            item.addEventListener('click', () => {
                alert('进入职位详情页');
            });
        });

        // 职位编辑相关功能
        const editModal = document.getElementById('edit-modal');
        const editJobForm = document.getElementById('edit-job-form');

        // 模拟职位数据
        const jobData = {
            1: {
                title: '前端开发工程师',
                company: '示例公司',
                postTime: '2024-01-01',
                views: 100,
                applications: 20,
                status: 'active',
                urgency: '普通',
                salary: '15k-25k',
                location: '北京',
                description: '负责公司Web前端开发工作，实现高质量用户界面和交互效果。',
                requirements: '1. 本科及以上学历，计算机相关专业；2. 3年以上前端开发经验；3. 熟悉Vue、React等主流框架；4. 良好的沟通能力和团队协作精神。',
                benefits: '五险一金、年终奖、带薪年假、节日福利',
                highlights: '团队氛围好、技术成长空间大'
            }
        };

        // 打开编辑弹窗
        function openEditModal(jobId) {
            const job = jobData[jobId];
            if (!job) return;

            // 填充表单数据
            document.getElementById('edit-job-title').value = job.title;
            document.getElementById('edit-salary-range').value = job.salary;
            document.getElementById('edit-location').value = job.location;
            document.getElementById('edit-urgency').value = job.urgency;
            document.getElementById('edit-job-description').value = job.description;
            document.getElementById('edit-requirements').value = job.requirements;
            document.getElementById('edit-benefits').value = job.benefits;
            document.getElementById('edit-highlights').value = job.highlights;

            // 显示弹窗
            editModal.style.display = 'flex';
        }

        // 关闭编辑弹窗
        function closeEditModal() {
            editModal.style.display = 'none';
            // 重置表单验证状态
            document.querySelectorAll('.form-group').forEach(group => {
                group.classList.remove('validation-error');
            });
        }

        // 表单验证
        function validateForm() {
            let isValid = true;
            const title = document.getElementById('edit-job-title').value.trim();
            const salary = document.getElementById('edit-salary-range').value.trim();
            const location = document.getElementById('edit-location').value.trim();
            const description = document.getElementById('edit-job-description').value.trim();
            const requirements = document.getElementById('edit-requirements').value.trim();

            // 职位名称验证
            if (!title) {
                showError('edit-job-title', '请输入职位名称');
                isValid = false;
            } else {
                hideError('edit-job-title');
            }

            // 薪资格式验证 (简单验证是否包含数字和k)
            const salaryRegex = /^\d+k?-\d+k?$/;
            if (!salary || !salaryRegex.test(salary)) {
                showError('edit-salary-range', '请输入有效的薪资范围（如：10k-20k）');
                isValid = false;
            } else {
                hideError('edit-salary-range');
            }

            // 工作地点验证
            if (!location) {
                showError('edit-location', '请输入工作地点');
                isValid = false;
            } else {
                hideError('edit-location');
            }

            // 岗位描述验证
            if (!description) {
                showError('edit-job-description', '请输入岗位描述');
                isValid = false;
            } else {
                hideError('edit-job-description');
            }

            // 任职要求验证
            if (!requirements) {
                showError('edit-requirements', '请输入任职要求');
                isValid = false;
            } else {
                hideError('edit-requirements');
            }

            return isValid;
        }

        // 显示错误提示
        function showError(fieldId, message) {
            const field = document.getElementById(fieldId);
            const errorElement = field.nextElementSibling;
            field.parentElement.classList.add('validation-error');
            errorElement.textContent = message;
            errorElement.style.display = 'block';
        }

        // 隐藏错误提示
        function hideError(fieldId) {
            const field = document.getElementById(fieldId);
            const errorElement = field.nextElementSibling;
            field.parentElement.classList.remove('validation-error');
            errorElement.style.display = 'none';
        }

        // 提交编辑表单
        editJobForm.addEventListener('submit', function(e) {
            e.preventDefault();
            if (validateForm()) {
                // 模拟保存成功
                alert('职位信息修改成功');
                // 更新表格数据（实际项目中会从服务器获取最新数据）
                const jobRow = document.querySelector('tr[data-id="1"]');
                if (jobRow) {
                    jobRow.querySelector('.job-name').textContent = document.getElementById('edit-job-title').value;
                    // 这里可以更新其他需要显示的字段
                }
                closeEditModal();
            }
        });
    </script>


    </div>
    <!-- 职位管理模块脚本 -->
    <script src="js/modules/job-management.js"></script>
    <script type="module">
        // 仅允许企业角色访问
        // protectRoute(['company']); // 如果需要保护，请确保 auth.js 中有 export 导出
    </script>
<script>
document.addEventListener('DOMContentLoaded', function() {
    // 获取当前企业信息
    fetch('http://localhost:3001/api/company/info')
        .then(response => response.json())
        .then(data => {
            if (data.companyName) {
                document.getElementById('current-company-name').textContent = data.companyName;
            }
            if (data.avatarUrl) {
                const avatar = document.querySelector('.avatar');
                avatar.style.backgroundImage = `url(${data.avatarUrl})`;
                avatar.style.backgroundSize = 'cover';
            }
        })
        .catch(error => console.error('获取企业信息失败:', error));
});
</script>
    <script src="js/company-recruitment.js"></script>
</body>
</html>



        <!-- 提交回复 -->
        <script>
        document.getElementById('replyForm').addEventListener('submit', function(e) {
            e.preventDefault();
            const resumeId = document.getElementById('resumeId').value;
            const content = document.getElementById('replyContent').value;
            const replyType = document.getElementById('replyType').value;
            const interviewTime = document.getElementById('interviewTime').value;
            
            // 简单验证
            if (!content.trim()) {
                showError(document.getElementById('replyContent'), '请输入回复内容');
                return;
            }
            
            // 模拟提交成功
            alert('回复发送成功！');
            closeReplyModal();
        });
        </script>
        

        </script>
        


        


        


       
        
        <!-- 简历详情弹窗 -->
        <div class="modal-overlay" id="resumeModal">
            <div class="modal">
                <div class="modal-header">
                    <h3 class="modal-title">简历详情</h3>
                    <button class="close-btn" onclick="closeResumeModal()">&times;</button>
                </div>
                <div id="resumeContent">
                    <!-- 简历内容将通过JS动态填充 -->
                </div>
            </div>
        </div>

        <!-- 回复求职者弹窗 -->
        <div class="modal-overlay" id="replyModal">
            <div class="modal">
                <div class="modal-header">
                    <h3 class="modal-title">回复求职者</h3>
                    <button class="close-btn" onclick="closeReplyModal()">&times;</button>
                </div>
                <form id="jobPostForm">
                    <input type="hidden" id="resumeId">
                    <div class="form-group">
                        <label for="replyContent">回复内容*</label>
                        <textarea id="replyContent" rows="6" required></textarea>
                        <div class="error-message">请输入回复内容</div>
                    </div>
                    <div class="form-group">
                        <label for="replyType">回复类型*</label>
                        <select id="replyType" required>
                            <option value="interview">面试邀请</option>
                            <option value="reject">婉拒</option>
                            <option value="other">其他</option>
                        </select>
                    </div>
                    <div class="form-group" id="interviewTimeGroup" style="display:none;">
                        <label for="interviewTime">面试时间</label>
                        <input type="datetime-local" id="interviewTime">
                    </div>
                    <div class="form-actions">
                        <button type="button" class="btn save-btn" onclick="closeReplyModal()">取消</button>
                        <button type="submit" class="btn submit-btn">提交</button>
                    </div>
                </form>
            </div>
        </div>

